<template>
    <div class="home">
           <div class="client">
               <ul>
                   <li class="box_msg" @click="hudong(item.fromUserId)" v-for="item in list" :key="item.id">
                       <div class="box_for">
                         <img :src="item.fromUserPhoto" alt="">
                         <!-- <span class="weidu">{{ceshi}}</span> -->
                       </div>
                       <div style=" margin-left:10px; float:left;">
                            <div class="title">{{item.fromUserName}}</div>
                            <div class="chongtu" v-html="item.msgContent"></div>
                       </div>
                       <div class="time">{{item.mtime |formatDate('YYYY-MM-DD hh:mm:ss')}}</div>
                   </li>
                    <!-- <li class="box_msg">
                       <div class="box_for">
                         <img src="../../assets/pingjia_11.png" alt="">
                         <span class="weidu">{{ceshi}}</span>
                       </div>
                       <div style="width:57%; margin-left:10px;">
                            <div class="title">购买时光ing</div>
                            <div class="text">你好 有人吗</div>
                       </div>
                       <div class="time">6月5日 12.06</div>
                   </li> -->
               </ul>
           </div>
    </div>
</template>

<script>
export default {
   data(){
       return{
           companyid:this.$route.query.companyid,
           ceshi:1,
           page:1,
           list:''
       }
   },
   mounted () {
       console.log(this.companyid)
       this.info()
   },
   methods:{
         info(){
             console.log(this.page)
          this.$http
        .get(this.APIURL_PREFIX + "/api/wap/companyMsgList",{params:{page:this.page,rows:10}})
        .then(res => {
            console.log(res)
            this.list=res.data.data
            if(this.list.lenth==''||this.list==""){
                alert('您暂时还没有聊天信息')
            }
        })
       },
       hudong(fromid){
              window.location='/wap/service.html?fromid='+fromid+'&'+'companyid='+this.companyid+'&'+'type='+1
       }
   }
}
</script>

<style>
@import "../../assets/personal/css/me_client.css";

</style>
